Skip to content

feat: the Android core comes from its release asset, pinned by version and checksum - #29

Merged
robingenz merged 3 commits into
mainfrom
feat/core-android-from-the-release-asset
Nov 2, 2026
Merged

robingenz merged 3 commits into
mainfrom
feat/core-android-from-the-release-asset

Conversation

@robingenz

Copy link
Copy Markdown
Member
  • The Android core is com.hotcodepush:core-android:0.1.0, the Maven-layout zip of core-android's 0.1.0 release: core-android-0.1.0-maven.zip.
  • package.json pins it under hotcodepush.coreAndroid: version 0.1.0, SHA-256 7c9b91381c5c99bf9e2592fd14e912972f0bb8f3df1b0a3c340a75ca5ef3a65b.
  • scripts/download-core-android.mjs runs in npm run build beside the iOS download. It checks the checksum, unpacks the zip into the ignored android/libs/m2, and skips the download while the pin is unchanged. It fails the build when android/build.gradle names another version than the pin.
  • The npm package carries the local Maven repository the way it carries the XCFramework. The script and its checksum marker stay out of the package.
  • android/build.gradle reads the local repository for the library, and android/hotcodepush.gradle for the app's :app, found beside the script file.
  • A customer's build no longer reads raw.githubusercontent.com: Gradle resolves the core from the package's own files and only its transitive dependencies (OkHttp, okio, coroutines) from Maven Central.
  • CLAUDE.md names the release asset and the checksum in the pin procedure, and the maven branch as the development pin only.

🤖 Generated with Claude Code

…n and checksum

The Android module took com.hotcodepush:core-android by full sha from core-android's maven branch, which every customer build read from raw.githubusercontent.com.
It now takes the Maven-layout zip of the 0.1.0 release: package.json pins its version and SHA-256 under hotcodepush.coreAndroid, and scripts/download-core-android.mjs checks the checksum and unpacks it into an ignored local Maven repository that ships in the npm package.
The script refuses a Gradle file that names another version than the pin, and the maven branch stays the development pin only.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 06:53
…entral

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Android downloader duplicates integrity-sensitive download and extraction logic and lacks regression tests for pin mismatches, checksum rejection, and cache hits.

2 open issues
What changed in this PR

This PR packages the Android native core with the React Native SDK, replacing Gradle downloads from the core’s development branch with a version- and checksum-pinned release asset.

Changes:

  • Adds an Android core downloader with checksum verification, caching, and Gradle version validation.
  • Includes the extracted Maven repository in the npm package and configures both Gradle scripts to use it.
  • Updates build commands and contributor documentation for the bundled Android core.
File Description
scripts/​download-core-android.mjs Downloads, verifies, and extracts the pinned Android core.
README.md Updates build instructions to mention both native cores.
package.json Pins the Android core, packages its artifacts, and wires download commands.
CLAUDE.md Documents release-asset pinning and local Maven resolution.
android/​hotcodepush.gradle Configures consuming apps to resolve the bundled core.
android/​build.gradle Uses the local Maven repository and core version 0.1.0.
.gitignore Excludes downloaded Android core artifacts from version control.

Review effort: Balanced

Comment on lines +35 to +38
if (gradleVersion !== version) {
throw new Error(
`android/build.gradle names core-android ${gradleVersion}, package.json pins ${version}`,
);
Comment on lines +53 to +57
const archive = Buffer.from(await response.arrayBuffer());
const actualChecksum = createHash('sha256').update(archive).digest('hex');
if (actualChecksum !== checksum) {
throw new Error(
`${url} has the checksum ${actualChecksum}, package.json pins ${checksum}`,
@pkg-pr-new

pkg-pr-new Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/hotcodepush-team/react-native-code-push/@hotcodepush/react-native-code-push@f9d5c88

commit: f9d5c88

@robingenz
robingenz merged commit 2a098b1 into main Nov 2, 2026
14 checks passed
@robingenz
robingenz deleted the feat/core-android-from-the-release-asset branch November 2, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants